*--------------------------------------------------Reproduction file for----------------------------------------------------------------*
*                                   Laustsen 2017: Choosing the Right Candidate:
* Observational and Experimental Evidence that Conservatives and Liberals Prefer Powerful and Warm Candidate Personalities, Respectively
*                                                    Political Behavior

**************************************************Study 2: Danish experiment*************************************************************


*------------------------------------------------Crates and recodes variables-----------------------------------------------------------*


***Creates experimental conditions for personality description of the fictitious candidate, Christian Mortensen:
recode Version (1 3 = 0 "Powerful") (2 4 = 1 "Warm") (else = .), generate(vignette) label(vignetteLB)


***Creates feeling thermometer ratings of the fictitious candidate, Christian Mortensen
recode spg20 (-99 = .), generate(feeling100)

*Recodes feeling thermometer rating to 0-1 scale on which "0" and "1" reflect most negative and positive feelings, respectively.
generate feeling = feeling100/100



***Creates ideology variable coded to 0-1 scale on which "0" = leftwing/liberal; "1" ) rightwing/conservative.
recode spg7 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) (8=8) (9=9) (10=10) (else =.), generate(ideology10)
generate ideology = ideology10/10

sum ideology

***Creates trait ratings of the two personality descriptions on 0-6 scales.
recode spg13 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (else =.), generate(agreeableness6)
recode spg14 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (else =.), generate(strong_leadership6)
recode spg15 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (else =.), generate(care_about6)
recode spg16 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (else =.), generate(dominant6)
recode spg17 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (else =.), generate(friendliness6)
recode spg18 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (else =.), generate(competitiveness6)
recode spg19 (0=0) (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (else =.), generate(competent6)

*Recodes trait ratings to 0-1 scales on which "0" and "1" srae min. and max. values.
generate agreeableness = agreeableness6/6
generate strong_leadership = strong_leadership6/6
generate care_about = care_about6/6
generate dominant = dominant6/6
generate friendliness = friendliness/6
generate competitiveness = competitiveness6/6
generate competent = competent6/6


***Creates variable for subject gender ("0" = female; "1" = male).
recode spg28 (1=0 "female") (2=1 "male") (else=.), generate(gender) label(genderLB)

*males and females in sample
tab gender


***Creates variable for subject age
generate age = spg29
summ age


*---------------------------------------Correlation between trait ratings (reported in note 13)-------------------------------------------*
*Correlations between traits related to Warmth
pwcorr agreeableness care_about friendliness, sig

*Correlations between traits related to Power
pwcorr dominant strong_leadership competitiveness, sig



*---------------------------Manipulation checks in perceptions of the two personality descriptions---------------------------------------*
** Perceived agreeableness
ttest agreeableness, by(vignette)

** Perceived dominance
ttest dominant, by(vignette)




*---------------------Interaction between personality description (Warm versus Powerful) and ideology-------------------------------------*
* Model reported in Table 2, Model C
reg feeling i.vignette##c.ideology

* Marginal efefct of ideology for subjects assigned to the Warm and the Powerful candidate description, respectively:
margins, dydx(ideology) over(vignette)

*Figure 2, panel C:
marginsplot, recastci(rcap) ciopts(lpattern(dash)) recast(bar) yline(0) xlabel(#2) ///
xtitle(Personality description) ytitle(Marg. effect of ideology on Feelings (DK)) title("") scheme(s2color)
